package io.renren.common.exception;


import io.renren.modules.impexp.controller.ResponseStatus;

/**
 * @description: 异常处理
 * @author: wurj
 * @Date: 2022/2/11 12:58:58
 */
public class BaseException extends RuntimeException {
    private Integer status;

    public Integer getStatus() {
        return status;
    }

    public BaseException(int status, String message) {
        super(message);
        this.status = status;
    }

    public BaseException(ResponseStatus responseStatus) {
        super(responseStatus.message());
        this.status = responseStatus.status();
    }

    public BaseException(ResponseStatus responseStatus, String... args) {
        super(responseStatus.formatMessage(args));
        this.status = responseStatus.status();
    }
}
